package com.aiju.support.async;

import android.app.Activity;

import com.aiju.widgit.dialog.DialogHelper;

/**
 * @version: V1.0
 * @author: 佐为
 * @date: 2016-10-19 10:15
 * @Description: 加载框的
 */
public abstract class TaskWithDialog<Params, Progress, Result> extends AbsAsyncTask<Params, Progress, Result> {

    protected Activity activity;
    protected DialogHelper dialogHelper;

    public TaskWithDialog(Activity paramActivity) {
        this.dialogHelper = new DialogHelper(paramActivity);
        this.activity = paramActivity;
    }

    @Override
    protected void onPreExecute() {
        if (this.activity != null){
            
            this.dialogHelper.showLoadingProgressDialog();
        }
    }

    protected void doFinally() {
        if (this.activity != null){
            this.dialogHelper.dismissProgressDialog();
        }
    }

}